package app

import bean.MajorCategoryMatch
import common.TApp
import controller.MajorCategoryAnalysisController
import org.apache.spark.streaming.dstream.DStream
import handler.JobMatchDataHandler

object MajorCategoryRealTimeApp extends TApp {
  private val controller = new MajorCategoryAnalysisController()

  start(appName = "MajorCategoryRealTimeApp") {
    // 从Kafka获取专业类别数据流
    val majorDataStream: DStream[MajorCategoryMatch] = 
      JobMatchDataHandler.kafkaMajorCategoryDataHandler("major_analysis_group", "ITproject")

    // 调度分析
    controller.dispatch(majorDataStream)

    // 启动流处理
    JobMatchDataHandler.startAndAwait()
  }
}